"""
@author: xxw
@file: homework_birthday.py
@time: 2023/3/31 16:47
"""
import time

birth = input("请输入生日日期，以-进行分割")
birthday = birth.split("-")
print(birthday)
year = int(birthday[0])
month = int(birthday[1])
day = int(birthday[2])
Y = int(time.strftime("%Y"))
M = int(time.strftime("%m"))
D = int(time.strftime("%d"))
age = Y - year
if month < M:
    print(f"你的年龄为{age}岁")
elif month > M:
    print("你的年龄为{}岁".format(age-1))
else:
    if day <= D:
        print(f"你的年龄为{age}岁")
    else:
        print("你的年龄为{}岁".format(age - 1))


